package constant.milk.cashbook.database;

import java.util.HashMap;

import constant.milk.cashbook.util.MilkUtil;


import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;

public class DbInsertQuery
{
	private Context context;
	private DbAdapter db;
	
	public DbInsertQuery(Context context, DbAdapter db)
	{
		this.context = context;
		this.db = db;
	}
	
	public void setBeginTansaction() throws Exception
	{
		db.beginTansaction(context);
	}
	
	public void setSuccessful() throws Exception
	{
		db.setTransactionSuccessful();
	}
	
	public void setEndTansaction() throws Exception
	{
		db.endTransaction(context);
	}
	
	/**
	 * 현금 테이블에 데이터를 삽입한다.
	 * @param context
	 * @param map
	 */
	public void setRealMoneyInsert(HashMap<String, String> map) throws Exception
	{
		db.insert(context, map, TableName.REAL_MONEY);
	}
	
	/**
	 * 통장 테이블에 데이터를 삽입한다.
	 * @param context
	 * @param map
	 */
	public void setBankBookInsert(HashMap<String, String> map) throws Exception
	{
		db.insert(context, map, TableName.BANK_BOOK);
	}
	
	/**
	 * 체크카드 테이블에 데이터를 삽입한다.
	 * @param context
	 * @param map
	 */
	public void setCheckCardInsert(HashMap<String, String> map) throws Exception
	{
		db.insert(context, map, TableName.CHECK_CARD);
	}
	
	/**
	 * 신용카드 테이블에 데이터를 삽입한다.
	 * @param context
	 * @param map
	 */
	public void setCreditCardInsert(HashMap<String, String> map) throws Exception
	{
		db.insert(context, map, TableName.CREDIT_CARD);
	}
	
	/**
	 * 핸드폰 테이블에 데이터를 삽입한다.
	 * @param context
	 * @param map
	 */
	public void setPhoneInsert(HashMap<String, String> map) throws Exception
	{
		db.insert(context, map, TableName.PHONE);
	}
	
	/**
	 * 상품권 테이블에 데이터를 삽입한다.
	 * @param context
	 * @param map
	 */
	public void setGiftCardInsert(HashMap<String, String> map) throws Exception
	{
		db.insert(context, map, TableName.GIFT_CARD);
	}
	
	public void setCategoryMain(HashMap<String, String> map) throws Exception
	{
		db.insert(context, map, TableName.CATEGORY_MAIN);
	}
	
	public void setCategorySub(HashMap<String, String> map) throws Exception
	{
		db.insert(context, map, TableName.CATEGORY_SUB);
	}
	
	public void setInOut(HashMap<String, String> map) throws Exception
	{
		db.insert(context, map, TableName.IN_OUT);
	}
	
	public void setAutoMain(HashMap<String, String> map) throws Exception
	{
		db.insert(context, map, TableName.AUTO_MAIN);
	}
	
	public void setSms(HashMap<String, String> map) throws Exception
	{
		db.insert(context, map, TableName.SMS);
	}
	
	public void setHalbu(HashMap<String, String> map) throws Exception
	{
		db.insert(context, map, TableName.HALBU);
	}
	
	public void setBudget(HashMap<String, String> map) throws Exception
	{
		db.insert(context, map, TableName.BUDGET);
	}
	
	public void setMainSetting(HashMap<String, String> map) throws Exception
	{
		db.insert(context, map, TableName.MAIN_SETTING);
	}
	
	public void setWidgetSetting(HashMap<String, String> map) throws Exception
	{
		db.insert(context, map, TableName.WIDGET_SETTING);
	}
	
	public void setAptData(HashMap<String, String> map) throws Exception
	{
		db.insert(context, map, TableName.APT_DATA);
	}
	
	public void setMyHouse(HashMap<String, String> map) throws Exception
	{
		db.insert(context, map, TableName.MY_HOUSE);
	}
}
